<%@ page language="java" contentType="text/html;charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@include file="/views/common/include/taglib.jsp"%>
<link type="text/css" rel="stylesheet" href="${ctx}/css/dlifestyle/header.css" />
<link type="text/css" rel="stylesheet" href="${ctx}/css/dlifestyle/tips.css" />
<script>
var ctx = '${ctx}';
//一级菜单点击
function clickFirstMenu(menuId){
	loadLeft(menuId);
}


function exist(){
	layer.confirm('确认注销?', {icon: 3, title:'提示'}, function(index){
	   	$.get("${ctx}/exist",{},function(data){
	   		data = JSON.parse(data);
			if(data.success){
				location.href = "${ctx}";
			}
		});
	    layer.close(index);
	});
    
}

function changePassword(userId){
	msg = "修改密码";
	url = ctx + "/user/changePassword?id=" + userId ;
	index = layer.open({
	      type: 2,
	      //skin: 'layui-layer-lan',
	      title: msg,
	      fix: false,
	      shadeClose: true,
	      scrollbar: false,
	      maxmin: false,
	      edit: true,
	      closeBtn: 1,
	      area: ['420px', '212px'],
	      content: url,
	      btn: ['确定', '取消']
		    ,yes: function(index, layero){ //或者使用btn1
		        //按钮【按钮一】的回调
		    	var iframeWin = window[layero.find('iframe')[0]['name']]; 
		    	iframeWin.savePwd();

		    },cancel: function(index){ //或者使用btn2
		        //按钮【按钮二】的回调
		    }
		});
}

/* function showTime(){    
	var show_day=new Array('星期一','星期二','星期三','星期四','星期五','星期六','星期日');    
	var time=new Date();    
	var year=time.getFullYear();    
	var month=time.getMonth();    
	var date=time.getDate();    
	var day=time.getDay();    
	var hour=time.getHours();    
	var minutes=time.getMinutes();    
	var second=time.getSeconds();    
	month<10?month=month:month;    
	month=month+1;    
	hour<10?hour='0'+hour:hour;    
	minutes<10?minutes='0'+minutes:minutes;    
	second<10?second='0'+second:second;    
	var now_time=year+'年'+month+'月'+date+'日'+' '+hour+':'+minutes+':'+second+' '+show_day[day-1];    
	document.getElementById('showtime').innerHTML=now_time;    
	};

	
	window.onload=function(){
		showTime();
		//定时器每秒调用一次showTime()
		setInterval(function(){
		showTime();
		},1000);
		} */
</script>

	<!--头部-->
	<div class="total-head">
	<div class="head">
		<!-- <span class="head-span-logo">LOGO</span> -->
		<span class="head-span-name"><img src="${ctx }/images/login/mainpage.png" style="position:relative;left:6px;vertical-align:middle;"/></span>
		
			  <div style="position: absolute;left: 500px;display: none">
             	    <div id="showtime"></div>
              </div>
            <div style="margin-right:100px;">
				<div><img class="navigate-bottom" src="${ctx }/images/system/navigateBottom.png"/></div>
				<div><img class="navigate-bottom" style="margin-right: -50px;" src="${ctx }/images/system/navigateBottom.png"/></div>
			</div>
			<div class="exist_blacktheme" style="margin-right:-25px;">
			    <a onclick="changePassword('${sessionScope.user_login.id}')">
				    <img class="navigate-bottom-img" src="${ctx }/images/system/password.png"/>
				    <span class="navigate-bottom-span">修改密码</span>
				</a>
			</div>
			<div class="exist_blacktheme" style="margin-right:-185px;">
			    <a onclick="exist()">
			    	<img class="navigate-bottom-img" src="${ctx }/images/system/exist_blacktheme.png"/>
				    <span class="navigate-bottom-span">退出系统</span>
				</a>
			</div>
		    <div class="user">
				<img src="${ctx }/images/system/user.png"/>
				<span>${sessionScope.user_login.username}</span>
			</div>
			<div class="select_cell_layout">
			<div class="select_cell">
			    <input id="cellname" type="text" maxlength="20" value="" class="input-sm" placeholder="搜索小区" style="background-color: #DFDFDF;height: 23px;line-height:23px;">
			</div>
			<div class="select_cell btn-group" style="float: none;background-color: #DFDFDF;height: 23px;padding: 0 0 0 0;">
                <input type="hidden" value="${cell.cellName}">
			    <select class="dropdown-menu-selectCell" id="cells" onchange="cellChange();" style="padding: 0px 0px;float: none;background-color: #DFDFDF;">
   				  	<c:if test="${sessionScope.user_login.userType == 0}">
   				  		<option value="" <c:if test="${sessionScope.user_login.currentCell == null}">selected="selected"</c:if>>选择小区</option> 
   				  	</c:if>
                    <c:forEach  items="${sessionScope.user_login.cellInfos}" var="cell" varStatus="cellStatus">
                     	<option value="${cell.id}" <c:if test="${sessionScope.user_login.currentCell.id == cell.id}">selected="selected"</c:if>>${cell.cellName}</option>
                    </c:forEach>
                </select>
			</div>
			</div>
	</div>
	
	<!-- <div class="header-bg"></div> -->
	
	<!--一级导航-->
   <div class="admin_header_nav">
    <div class="admin_nav_list">
      <div class="admin_nav"> 
          <ul class="admin_nav_ul">
          	<div >
				<a href = "javascript:loadLeft('${sessionScope.user_login.menu.id}');"><img class="admin_nav_ul_home_img" src="${ctx }/images/system/home.png"/><span class="admin_nav_ul_home">主页 >></span></a>
			</div>
        	<c:forEach items="${sessionScope.menus}" var="menu" varStatus="menuStatus">
	         	<li id="firstMenu${menu.id}" name="firstMenu" onclick="clickFirstMenu('${menu.id}');" class="admin_nav_ul_li">
	                <a style="cursor: pointer;">${menu.menuName}</a>
	            </li>
        	</c:forEach>
          </ul>      
      </div>
    </div>
  </div> 
</div>